package edu.nf.waimai.service.order.impl;

import edu.nf.waimai.dao.order.OrderDAO;
import edu.nf.waimai.dao.order.impl.OrderDAOImpl;
import edu.nf.waimai.model.order.Order;
import edu.nf.waimai.model.order.UserOrder;
import edu.nf.waimai.service.order.OrderService;

import java.util.List;

/**
 * @Date 2023/6/26
 * @Author zgm
 */

public class OrderServiceImpl implements OrderService {

    @Override
    public int addOrder(Order order) {
        OrderDAO dao = new OrderDAOImpl();
        int row = dao.addOrder(order);
        return row;
    }

    @Override
    public List<UserOrder> queryOrder(Integer uid, String orderType) {
        OrderDAO dao = new OrderDAOImpl();
        List<UserOrder> list = dao.listOrder(uid,orderType);
        return list;
    }

    @Override
    public int updateOrderStatus(String orderId, Integer status) {
        OrderDAO dao = new OrderDAOImpl();
        int row = dao.updateOrder(orderId, status);
        return row;
    }
}
